import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from '@renderer/App.vue'
import router from '@renderer/routes'

import '@renderer/assets/scss/fonts.scss'
import '@renderer/assets/scss/theme.scss'
import '@renderer/assets/scss/style.scss'

import { useChatListStore } from '@renderer/store/chatList'
import { useSettingStore } from '@renderer/store/setting'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'; // 引入 Element Plus 的默认样式


const pinia = createPinia()
const app = createApp(App)
app.use(ElementPlus)
app.use(pinia)
app.use(router)
;(async () => {
    //初始化pinia数据
    // const chatListStore = useChatListStore()
    // chatListStore.insertMany(await $store.getChatlist())

    const settingStore = useSettingStore()
    settingStore.init(await $store.getAllSettings())

    app.mount('#app')
})()
